//@author A0105543N
#include "Trace.h"

Trace::Trace()
{
	totalXpens = 0;
	totalPayment = 0;
}

void Trace::addTrace(Item& thisItem){

	if (thisItem.isexpense()) totalXpens += thisItem.getPrice();
	else totalPayment += thisItem.getPrice();
}

void Trace::deleteTrace(Item& thisItem){
	if (thisItem.isexpense()) totalXpens = totalXpens - thisItem.getPrice();
	else totalPayment = totalPayment - thisItem.getPrice();
}

double Trace::gettotalXpens()
{
	return totalXpens;
}

double Trace::gettotalPayment()
{
	return totalPayment;
}

void Trace::initialize(double tp,double tx)
{
	totalXpens = tx;
	totalPayment = tp;
}